﻿using System;
using System.Windows.Controls;
using System.Windows.Xps.Packaging;

namespace DocumentManager.WPFElements.UserControls
{
	/// <summary>
	/// Interaction logic for DocumentViewer.xaml
	/// </summary>
	public partial class DocumentViewer : UserControl
	{
		#region Constructors

		public DocumentViewer(XpsDocument xpsDocument)
		{
			InitializeComponent();

			if (xpsDocument == null)
				throw new ArgumentNullException(string.Format("xps Document"));

			dvDocuments.Document = xpsDocument.GetFixedDocumentSequence();

			xpsDocument.Close();
		}

		#endregion
	}
}
